// components/tabbar/tabbar.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    active: {
      type: Number,
      value: 0
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
		active: 0,
		list: [
      {
        "url": "/pages/main/main",
        "text": "首页",
        "icon": "/static/images/tab-bar/home0.png",
        "activeIcon": "/static/images/tab-bar/home1.png"
      },
      {
        "url": "/pages/recruit/recruit",
        "text": "求职招聘",
        "icon": "/static/images/tab-bar/recruit0.png",
        "activeIcon": "/static/images/tab-bar/recruit1.png"
      },
      {
        "url": "/pages/shop-sell/shop-sell",
        "text": "买店卖店",
        "icon": "/static/images/tab-bar/shop0.png",
        "activeIcon": "/static/images/tab-bar/shop1.png"
      },
      {
        "url": "/pages/supply/supply",
        "text": "供应商",
        "icon": "/static/images/tab-bar/supply0.png",
        "activeIcon": "/static/images/tab-bar/supply1.png"
      },
      {
        "url": "/pages/me/me",
        "text": "我的",
        "icon": "/static/images/tab-bar/me0.png",
        "activeIcon": "/static/images/tab-bar/me1.png"
      }
		]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onTabChange (e) {
      this.setData({
        active: e.detail
      })
      wx.switchTab({
        url: this.data.list[e.detail].url
      })
    }
  }
})
